import VueRouter from 'vue-router'
// 导入对应的路由组件
import HomeContainer from './compontents/tabber/HomeContainer.vue'
import PluesContainer from './compontents/tabber/PluesContainer.vue'
import SearchContainer from './compontents/tabber/SearchContainer.vue'
import ShopContainer from './compontents/tabber/ShopContainer.vue'
import NewsList from './compontents/news/NewsList.vue'
import NewsInfo from './compontents/news/NewsInfo.vue'
import PhotoList from './compontents/photos/PhotoList.vue'
import PhotoInfo from './compontents/photos/PhotoInfo.vue'
import GoodsList from './compontents/goods/GoodsList.vue'
import GoodsInfo from './compontents/goods/GoodsInfo.vue'
import GoodsDesc from './compontents/goods/GoodsDesc.vue'
import GoodsComment from './compontents/goods/GoodsComment.vue'

var router = new VueRouter({

    routes: [
        {
            path: '/', redirect: HomeContainer
        },
        {
            path: "/home", component: HomeContainer
        }, {
            path: "/PLUS", component: PluesContainer
        }, {
            path: "/shop", component: SearchContainer
        }, {
            path: "/search", component: ShopContainer
        }, {
            path: '/home/newslist', component: NewsList
        }, {
            path: '/home/newsinfo/:id', component: NewsInfo
        }, {
            path: '/home/photolist', component: PhotoList
        }, {
            path: '/home/photoinfo/:id', component: PhotoInfo
        }, {
            path: '/home/goodslist', component: GoodsList
        }, {
            path: '/home/goodsinfo/:id', component: GoodsInfo
        }, {
            path: '/home/goodsdesc/:id', component: GoodsDesc, name: "goodsdesc"
        },
        {
            path: '/home/goodscomment/:id', component: GoodsComment, name: "goodscomment"
        }
    ],
    linkActiveClass: 'mui-active'
})
export default router

// 点击链接，地址栏改变，路由会监听到地址栏的改变，会进行路由匹配，当匹配到链接组件，会展示对应的组